{extend name="common/default" /}
{block name="style"}
<style>
    .rexam-item{
        display: flex;
        flex-direction: column;
        overflow: hidden;
        position: relative;
        margin-bottom: 16px;
        box-shadow: 5px 5px 3px #888888;
        border-radius: 8px;
    }
    .rexam-item .rexem-head{
        width: 100%;
    }
    .rexam-item .rexam-name{
        background: #000;
        color: #ffffff;
        padding-left: 16px;
    }
    .rexam-item p{
        width: 100%;
        background: #7e7e7e;
        color: #ffffff;
        line-height: 1.6rem;
        padding-left: 16px;
    }
    .rexam-item .rexem-stamp{
        position: absolute;
        bottom: 0;
        right: 0;
    }
    .weui-bar__item_on img{
        position: relative;
        left: -10000px;
        filter: drop-shadow(10000px 0 0 #07c160);
    }
    .weui-tab__panel{
        padding: 16px;
    }
    .page__hd{
        padding:16px;
    }
    .stamp-font{
        font-size: 1.5rem;
        text-shadow: 3px 3px 3px #000000;
        color: white;
        padding: .3rem 1rem;
        background: #07c160;
        border-top-left-radius: 8px;
    }
    .doing{
        background: #e23018;
    }
    .finished{
        background: #07c160;
    }
</style>
{/block}

{block name="container"}
<div class="container">
    <div class="page js_show">
        <div class="page__bd" style="height: 100%;">
            <div class="weui-tab">
                <div class="weui-tab__panel">
                    {foreach name="list" item="vo"}
                    <a href="{:addon_url('rexam/rexam/index',['id'=>$vo['id']])}">
                        <div class="rexam-item" data-url="{:addon_url('rexam/rexam/index',['id'=>$vo['id']])}">
                            <img class="rexem-head" src="{$vo.headfile|cdnurl}" title="{$vo.name}"/>
                            <h2 class="rexam-name">{$vo.name}</h2>
                            {if condition="$vo.rexam_status eq 2"}
                            <!--答题中-->
                            <!--<img class="rexem-stamp" src="__ADDON__/justdo.png"/>-->
                            <div class="rexem-stamp stamp-font doing">答题中</div>
                            {elseif  condition="$vo.rexam_status eq 3" /}
                            <!--已完成-->
                            <!--<img class="rexem-stamp" src="__ADDON__/finished.png"/>-->
                            <div class="rexem-stamp stamp-font finished">已完成</div>
                            {elseif  condition="$vo.rexam_status eq 1" /}
                            <!--已开始-->
                            <p><strong>截止时间：</strong>{:date('Y-m-d H:i:s',$vo.expiretime)}</p>
                            {else /}
                            <!--未开始-->
                            <p><strong>开始时间：</strong>{:date('Y-m-d H:i:s',$vo.starttime)}</p>
                            {/if}
                        </div>
                    </a>
                    {/foreach}
                </div>
                <div class="weui-tabbar">
                    <div class="weui-tabbar__item weui-bar__item_on" data-url="{:addon_url('rexam/index/index')}">
                        <div style="display: inline-block; position: relative;">
                            <img src="__ADDON__/home.svg" alt="" class="weui-tabbar__icon">
                        </div>
                        <p class="weui-tabbar__label">答题</p>
                    </div>
                    <div class="weui-tabbar__item" data-url="{:addon_url('rexam/index/ranking')}">
                        <img src="__ADDON__/ranking.svg" alt="" class="weui-tabbar__icon">
                        <p class="weui-tabbar__label">排行榜</p>
                    </div>
                    <div class="weui-tabbar__item" data-url="{:addon_url('rexam/index/me')}">
                        <img src="__ADDON__/me.svg" alt="" class="weui-tabbar__icon">
                        <p class="weui-tabbar__label">我</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{/block}

{block name="javascript"}

{/block}
